<%@page pageEncoding="UTF-8"  contentType="application/json; charset=UTF-8"  %>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@taglib uri="http://chances.com.cn/jsp/epgdata" prefix="epgdata"%>


<epgdata:categoryItem var="menu_cat" size="4" code="${_templateParams['menu_cat']}" />
<epgdata:categoryItem var="big_cat" size="999" code="${_templateParams['big_cat']}" />
<epgdata:categoryItem var="historySearch_cat" size="2" code="${_templateParams['historySearch_cat']}" />
<c:set var="historyUrl" value="${historySearch_cat[0].url}" scope="application"/>
<c:set var="searchUrl" value="${historySearch_cat[1].url}" scope="application"/>
<epgdata:biz var="person_biz" code="${_templateParams['bind_biz']}"/>
<c:set value="${person_biz.url}" var="personUrl" scope="application"/>
<c:set value="${menu_cat[1].itemCode}" var="liveBizCode" scope="application"/>
<epgdata:bizList var="bizes" code="${_templateParams['rec_biz']}"/>

{
	"status": "200",
	"title": "_context.biz.title",
	"code": "${_context.bizCode}",
	"areaDatas": 
	[
		
		{
			"areaCode":"${_templateParams['menu_cat']}",
			"areaType": "",
			"areaTitle": "导航",
			"items":[
				
				<c:forEach var="item" items="${menu_cat}" varStatus="idx">
					{
					"itemTitle": "${item.title}",
					"itemCode": "${item.itemCode}",
					"itemType": "${item.itemType}",
					"itemIcon": "${item.itemIcon}",
					"dataLink": "${item.url}"
					}<c:if test="${!idx.last }">,</c:if>
				</c:forEach>
			]
		},
		{
			"areaCode":"${_templateParams['menu_cat']}",
			"areaType": "",
			"areaTitle": "历史搜索",
			"items":[
				<c:set var="imgSrc" value="${_templatePath}/images/menu_hs.png"/>
				<c:forEach var="item" items="${historySearch_cat}" varStatus="idx">
				<c:if test="${idx.index >0}">
					<c:set var="imgSrc" value="${_templatePath}/images/menu_sch.png"/>
				</c:if>
					{
					"itemTitle": "${item.title}",
					"itemCode": "${item.itemCode}",
					"itemType": "${item.itemType}",
					"itemIcon": "${_resourcePath}${imgSrc}",
					"dataLink": "${item.url}"
					}<c:if test="${!idx.last }">,</c:if>
				</c:forEach>
			]
		},
		{
			"areaCode":"${_templateParams['big_cat']}",
			"areaType": "",
			"areaTitle": "大图轮播",
			"items":[
				<c:forEach var="item" items="${big_cat}" varStatus="idx">
					{
					"itemTitle": "${item.title}",
					"itemCode": "${item.itemCode}",
					"itemType": "${item.itemType}",
					"itemIcon": "${_resourcePath}${item.itemIcon}",
					"contentPoster": "${_resourcePath}${item.contentStill}",
					"dataLink": "${item.url}"
					}<c:if test="${!idx.last }">,</c:if>
				</c:forEach>
			]
		},
		{
			"areaCode":"${_templateParams['rec_biz']}",
			"areaType": "",
			"areaTitle": "各类内容",
			"items":[
				<c:forEach items="${bizes}" var="biz" varStatus="idx">
				{
					"areaCode":"${biz.code}",
					"areaType": "biz",
					"areaTitle": "${biz.title}",
					"areaIcon": "${_resourcePath}${biz.icon}",
					"items":[
						<epgdata:categoryItem size="3" code="${biz.categoryCode}" var="items" />
						<c:forEach var="item" items="${items}" varStatus="index">
							<epgdata:content var="content" type="${item.itemType}" code="${item.itemCode}"/>
							<c:set var="imgSrc" value="${_contextPath}/sites/weixin/images/defaultBg_2.jpg" />
							<c:if test="${not empty content.poster}">
								<c:set var="imgSrc" value="${_resourcePath}${content.poster}" />	
							</c:if>
							<c:if test="${not empty item.itemIcon}">
								<c:set var="imgSrc" value="${_resourcePath}${item.itemIcon}" />	
							</c:if>
							{
							"itemTitle": "${item.title}",
							"itemCode": "${item.itemCode}",
							"itemType": "${item.itemType}",
							"contentPoster":"${imgSrc}",
							"dataLink": "${item.url}"
							}<c:if test="${!index.last }">,</c:if>
						</c:forEach>
					]
				}<c:if test="${!idx.last }">,</c:if>
				</c:forEach>
			]}
	]
}
